{% extends "devops/base.html" %}
<!-- 列表页固定信息 -->
{% block server_info %}<li><a href="server">服务器</a></li>{% endblock %}
{% block release_ga %}<li class="active"><a href="release">代码上线</a></li>{% endblock %}
{% block job_admin %}<li><a href="job">job管理</a></li>{% endblock %}
{% block user_info %}<li><a href="user">用户</a></li>{% endblock %}









<!-- 右侧栏信息-->
{% block txt_info %}
        <div class="span10">
        <div class="hero-unit">
            <div class="row-fluid">
            <h3>代码上线</h3>
            <p class="text-success">TOMCAT目前只支持线下服务重启</p>
                <p class="text-warning">(WINDOWS上传代码)-运行-输入\\192.168.0.210\姓名-将代码替换-上传完成点击下面重启tomcat即可</p>
                <table class="table table-bordered table-hover">
                    <thead>
                        <tr>
                        <th data-resizable-column-id="name">名字</th>
                        <th data-resizable-column-id="port">端口</th>
                        <th data-resizable-column-id="url">访问地址</th>
                        <th data-resizable-column-id="cmd">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <script src="static/bootstrap/js/jquery.min.js" ></script>
<script>
  $(function(){
      // 调用方法
      xxx('张明明',8080,'http://zhangmingming.dev.fdmdns.com');
      xxx('程乾亮',8180,'http://chengqianliang.dev.fdmdns.com');
      xxx('徐晋阳',8280,'http://xujinyang.dev.fdmdns.com');
  });
  
  // 你自己写的function 写这里
  function xxx(name,num,ip){
    var str =   '       <tr>';
        str +=  '                <td>'+name+'</td>';
        str +=  '                <td>'+num+'</td>';
        str +=  '                <td>'+ip+'</td>';
        str +=  '                <td alig="center"n>';
        str +=  '                <form method="GET" action="release/office" style="padding:0;margin:0;float:left;width:70px;height:10px;" >';
        str +=  '                {% csrf_token %}';
        str +=  '                <input class=hide name="cmd" value="start" />';
        str +=  '                <input class=hide name="post" value="'+num+'" />';
        str +=  '                <input class="btn btn-primary btn-small" data-toggle="modal" id="modal-681917" href="#modal-container-681917" type="submit" name="Submit2" value="START">';
        str +=  '                </form>';
        str +=  '                <form method="GET" action="release/office" style="padding:0;margin:0;float:left;width:63px;height:10px;">';
        str +=  '                {% csrf_token %}';
        str +=  '                <input class=hide name="cmd" value="stop" />';
        str +=  '                <input class=hide name="post" value="'+num+'" />';
        str +=  '                <input class="btn btn-primary btn-small" type="submit" name="Submit2" value="STOP">';
        str +=  '                </form>';
        str +=  '                <form method="GET" action="release/office" style="padding:0;margin:0;float:left;" >';
        str +=  '                {% csrf_token %}';
        str +=  '                <input class=hide name="cmd" value="restart" />';
        str +=  '                <input class=hide name="post" value="'+num+'" />';
        str +=  '                <input class="btn btn-primary btn-small" type="submit" name="Submit2" value="RESTART">';
        str +=  '                </form>';
        str +=  '           </tr>';
     $('tbody').append(str);
  }
                        </script>
                    </tbody>
                </table>
            </div>
        </div>
      <hr>
      <footer>
        <p>&copy; Company 2014</p>
      </footer>
    </div>
{% endblock %}
